# -*- coding:utf-8 -*-
"""
@file: ner_svc_main.py
@time: 2019/12/16 18:17
@author: ljt
descript:
"""
import sys

from tornado.ioloop import IOLoop
import tornado.web
from ScoreCard.config.urls_config import urls
import tornado.httpserver
from ScoreCard.log.logger_config import logger

application = tornado.web.Application(urls, debug=False)

if __name__ == "__main__":
    SERVER_PORT = 6688 if len(sys.argv) < 2 else int(sys.argv[1])
    http_server = tornado.httpserver.HTTPServer(application)
    http_server.bind(SERVER_PORT)
    http_server.start()
    logger.info('tornado server started on port {port}'.format(port=SERVER_PORT))
    IOLoop.current().start()
